|
SET OBJECT TEXTURE
This command will set different texture modes used by the specified object.
SET OBJECT TEXTURE Object Number, Texturing Mode, Mipmap Flag
SET OBJECT TEXTURE Object Number, Stage Number, Texturing Mode, Mipmap Flag
Object Number
Integer
The object number
Stage Number
Integer
Setting the Texture Wrap Mode to zero will use the default wrap mode which repeat the pattern of the texture over and over
Texturing Mode
Integer
The Mipmap Generation Flag is used to ensure the image has a mipmap texture
Mipmap Flag
Integer
Specify a value of zero to disable, and a value of one to enable.
This command does not return a value.
Every texture is painted onto an object using an internal set of values called UV data. This data contains a range of real numbers from zero to one. Zero specifying the top/left corner of your texture and one being the bottom/right corner of your texture. When an object uses UV data greater and less than this range, you are permitted a number of texture wrap modes to describe what should happen to paint these areas. Setting the Texture Wrap Mode to zero will use the default wrap mode which repeat the pattern of the texture over and over, a mode of one will mirror the texture to create a seamless texture pattern and a mode of two will set clamping which retains the colour of the last pixel at the textures edge and paint with that throughout the out of range area. The Mipmap Generation Flag is used to ensure the image has a mipmap texture. A mipmap is a texture that has many levels of detail, which the object can select and use based on the objects distance from the camera. Use integer values to specify the parameters.
hide mouse:cls 0:autocam off
ObjectNumber=1
SecondObject=2
ImageNumber=1
make object sphere SecondObject,1
load object "models\model.x",ObjectNumber
load image "iron.jpg",ImageNumber
append object "models\extraanim.x", ObjectNumber, total object frames(ObjectNumber)+1
set object interpolation ObjectNumber,50
position object ObjectNumber,0,0,0
position object SecondObject,0,0,0
position camera 0,2,4
point camera 0,0,0
texture object ObjectNumber, ImageNumber
set object texture ObjectNumber,0,1
while mouseclick()=0:endwhile
if object exist(ObjectNumber)=1 then delete object ObjectNumber
if object exist(SecondObject)=1 then delete object SecondObject
if image exist(ImageNumber)=1 then delete image ImageNumber
end
BASIC3D Commands Menu
Index
|